﻿using HeyPiPi_Desk.Base;
using HeyPiPi_Desk.Tools;
using Microsoft.Practices.Prism.Commands;
using Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace HeyPiPi_Desk.DomainViewModel
{
    public class VIPBuyCardViewModel: BaseNotification
    {
        #region 字段/属性
        private ObservableCollection<string>   _yearList;

        /// <summary>
        /// 从1990年开始到今年的年份列表
        /// </summary>
        public ObservableCollection<string> YearList
        {
            get {
                for (int i = 1990; i <= DateTime.Now.Year; i++)
                {
                    _yearList.Add(i.ToString());
                }
                return _yearList;

            }
            set { _yearList = value;this.RaisePropertyChanged(() => this.YearList); }
        }


        private ObservableCollection<string> _monthList;

        /// <summary>
        /// 月份列表
        /// </summary>
        public ObservableCollection<string> MonthList
        {
            get {
                for (int i = 0; i <= 12; i++)
                {
                    this._monthList.Add(i.ToString());
                }
                
                return _monthList; }
            set { _monthList = value; this.RaisePropertyChanged(() => this.MonthList); }
        }

        private ObservableCollection<string> _dayList;

        /// <summary>
        /// 天份列表
        /// </summary>
        public ObservableCollection<string> DayList
        {
            get {
                for (int i = 1; i <= 31; i++)
                {
                    this._dayList.Add(i.ToString());
                }
                return _dayList; }
            set { _dayList = value; }
        }


        private string _selectYear;

        /// <summary>
        /// 被选择的年份
        /// </summary>
        public string SelectYear
        {
            get { return _selectYear; }
            set { _selectYear = value;this.RaisePropertyChanged(() => this.SelectYear); }
        }

        private string _selectMonth;

        /// <summary>
        /// 被选择的月份
        /// </summary>
        public string SelectMonth
        {
            get { return _selectMonth; }
            set { _selectMonth = value;this.RaisePropertyChanged(() => this.SelectMonth); }
        }

        private string _selectDay;

        /// <summary>
        /// 被选择的天份
        /// </summary>
        public string SelectDay
        {
            get { return _selectDay; }
            set { _selectDay = value;this.RaisePropertyChanged(() => this.SelectDay); }
        }

        private string _vipName;

        /// <summary>
        /// 会员姓名
        /// </summary>
        public string VipName
        {
            get { return _vipName; }
            set { _vipName = value;this.RaisePropertyChanged(() => this.VipName); }
        }


        private string _vipPhone;

        /// <summary>
        /// 会员号码
        /// </summary>
        public string VipPhone
        {
            get { return _vipPhone; }
            set { _vipPhone = value;this.RaisePropertyChanged(() => this.VipPhone); }
        }

        private string _vipCardCode;

        /// <summary>
        /// vip实体卡号，根据某种规则生成
        /// </summary>
        public string VipCardCode
        {
            get { return _vipCardCode; }
            set { _vipCardCode = value; this.RaisePropertyChanged(() => this.VipCardCode); }
        }

        private PasswordBox _password;

        /// <summary>
        /// 会员密码
        /// </summary>
        public PasswordBox Password
        {
            get { return _password; }
            set { _password = value; }
        }

        private string _summary;

        public string Summary
        {
            get { return _summary; }
            set { _summary = value; this.RaisePropertyChanged(() => this.Summary); }
        }


        private string _vipImage;

        /// <summary>
        /// vip用户头像
        /// </summary>
        public string VipImage
        {
            get { return _vipImage; }
            set { _vipImage = value; this.RaisePropertyChanged(() => this.VipImage); }
        }


        private string _vipPoint="0";

        /// <summary>
        /// 会员积分 选填
        /// </summary>
        public string VipPoint
        {
            get { return _vipPoint; }
            set { _vipPoint = value; this.RaisePropertyChanged(() => this.VipPoint); }
        }

        private string _vipDiscount;

        /// <summary>
        /// 会员折扣
        /// </summary>
        public string VipDiscount
        {
            get { return _vipDiscount; }
            set { _vipDiscount = value;this.RaisePropertyChanged(() => this.VipDiscount); }
        }

        private string _cardLimit;
        /// <summary>
        /// 时卡期限
        /// </summary>
        public string CardLimit
        {
            get { return _cardLimit; }
            set { _cardLimit = value;this.RaisePropertyChanged(() => this.CardLimit); }
        }

        private shop_Viplevel _selectVipLevel;

        /// <summary>
        /// 被选择的会员等级
        /// </summary>
        public shop_Viplevel SelectVipLevel
        {
            get { return _selectVipLevel; }
            set { _selectVipLevel = value;this.RaisePropertyChanged(()=>this.SelectVipLevel); }
        }

        private shop_PayType _selectPayType;

        /// <summary>
        /// 所选择的支付类型
        /// </summary>
        public shop_PayType SelectPayType
        {
            get { return _selectPayType; }
            set { _selectPayType = value; this.RaisePropertyChanged(() => this.SelectPayType); }
        }

        private string _payMoney="0";

        /// <summary>
        /// 支付金额 选填
        /// </summary>
        public string PayMoney
        {
            get { return _payMoney; }
            set { _payMoney = value; this.RaisePropertyChanged(() => this.PayMoney); }
        }

        private string _fineMoney;

        /// <summary>
        /// 赠送金额
        /// </summary>
        public string FineMoney
        {
            get { return _fineMoney; }
            set { _fineMoney = value;this.RaisePropertyChanged(() => this.FineMoney); }
        }

        private ObservableCollection<shop_Viplevel> _vipLevels;

        /// <summary>
        /// 会员等级列表
        /// </summary>
        public ObservableCollection<shop_Viplevel> VipLevels
        {
            get { return _vipLevels; }
            set { _vipLevels = value; this.RaisePropertyChanged(() => this.VipLevels); }
        }


        private ObservableCollection<shop_PayType> _payTypes;

        /// <summary>
        /// 支付方式集合
        /// </summary>
        public ObservableCollection<shop_PayType> PayTypes
        {
            get { return _payTypes; }
            set { _payTypes = value; this.RaisePropertyChanged(() => this.PayTypes); }
        }

        /// <summary>
        /// 保存命令
        /// </summary>
        public DelegateCommand Save_Cmd{ get; set; }
        /// <summary>
        /// 打开等级管理
        /// </summary>
        public DelegateCommand OpenLevelWindow_Cmd { get; set; }

        #endregion

        #region 私有方法

        /// <summary>
        /// 初始化命令和数据
        /// </summary>
        private void _initFunc()
        {
            ///打开等级管理窗口
            this.OpenLevelWindow_Cmd = new DelegateCommand(() =>
            {
                DomainResponsitory.GetInstance().ChangedPanel("会员等级管理", DomainOpenMethod.PageOpen);

            });

        }


        #endregion

        #region 共有方法

        /// <summary>
        /// 构造函数
        /// </summary>
        public VIPBuyCardViewModel()
        {
            this._initFunc();
        }
        #endregion
    }
}
